/**
 * Created by lihao on 2017-05-27.
 */
angular.factory('WaybillBoard',function(){
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('Reportform-state'));

    // 指定图表的配置项和数据
    var option = {
        title : {
            text: '运单状态',
            subtext: '纯属虚构',
            x:'center'
        },
        tooltip : {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            left: 'left-center',
            data: ['新增','提交','已回单']
        },
        series : [
            {
                name: '运单状态',
                type: 'pie',
                radius : '55%',
                center: ['50%', '60%'],
                data:[
                    {value:156, name:'新增'},
                    {value:123, name:'提交'},
                    {value:234, name:'已回单'},
//                    {value:135, name:'视频广告'},
//                    {value:1548, name:'搜索引擎'}
                ],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
});